package bairui.international.console.web.controller.college.category.college;

/**
 * @see bairui.international.console.web.controller.college.category.college.Page_BaseFilter
 *
 */
class Page_Filter

{
	
	/**
	 * 过滤扩展接口
	 */
	static interface FilterExtends {
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_College QRoot,
		javax.servlet.http.HttpServletRequest request
	) {
		com.querydsl.core.BooleanBuilder query = query(
				QRoot
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("title"), 
						String.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("bigImgFlag"), 
						Boolean.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("state"), 
						com.lianjing.sh.model.uml.model.status.State_UpDown.class, 
						"yyyy-MM-dd"
					)
	,			com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("date_start"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					),
				com.sh_lianjing.string.util.Util_String.parseToType(
						request.getParameter("date_end"), 
						java.util.Date.class, 
						"yyyy-MM-dd"
					)
			);
			/* comment 附加过滤属性 */
	;
		return query;
	}
	
	final static com.querydsl.core.BooleanBuilder query(
		bairui.international.model.domain.jpa.QTB_College QRoot
	,	String title
	,	Boolean bigImgFlag
	,	com.lianjing.sh.model.uml.model.status.State_UpDown state
	,	java.util.Date date_start,
		java.util.Date date_end
	) {
		com.querydsl.core.BooleanBuilder builder = new com.querydsl.core.BooleanBuilder();
	
		if(null != title){
			builder.and(QRoot.title.like("%"+title+"%"));
		}
		if(null != bigImgFlag){
			builder.and(QRoot.bigImgFlag.eq(bigImgFlag));
		}
		if(null != state){
			builder.and(QRoot.state.eq(state));
		}
		if(null != date_start && null != date_end){
			builder.and(QRoot.date.between(date_start, date_end));
		}
		return builder;
	}
	
}
